package com.xiongwei.singleton;

/**
 * 饿汉式(静态代码块)：在静态代码块中创建对象
 * 优缺点与静态常量方式基本相同
 */
public class HungerMan2 {

    private HungerMan2() {

    }

    private static HungerMan2 instance;

    static {
        instance = new HungerMan2();
    }

    public static HungerMan2 getInstance() {
        return instance;
    }
}
